<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-供应商信息管理">
</@frame.head>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/search_table.css" />
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span> 采购管理 <span class="c-gray en">&gt;</span> 供应商信息管理<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
   <div class="text-c">
    <form action="${contextPath}/manager_merchant/query_merchant_list" method="post" name="search_form" id="search_form">
        <input type="hidden" name="page" value="${pagination.pageNo}"  id="page" />
        <table class="table search_table" >
          <tr>
		   <td>登录账户：</td>
           <td><input type="text" class="input-text  radius"  placeholder="请输入登录账户" name="merchantLoginName" value="${merchantQo.merchantLoginName}"  >
           </td>  
		   <td>供应商名称：</td>
           <td><input type="text" class="input-text  radius"  placeholder="请输入供应商名称" name="merchantName" value="${merchantQo.merchantName}"  >
           </td>  
		   <td>联系人：</td>
           <td><input type="text" class="input-text  radius"  placeholder="请输入联系人" name="linkMan" value="${merchantQo.linkMan}"  >
           </td> 
          </tr>  
          <tr>		   
		   <td>联系电话：</td>
           <td><input type="text" class="input-text  radius"  placeholder="请输入联系电话" name="linkTel" value="${merchantQo.linkTel}"  onkeyup="this.value=this.value.replace(/[^\d]/g,'') " >
           </td>
		   <td>状态：</td>
		   <td>
           <span class="select-box radius">
           <select class="select"  name="valid" >
            <option value>请选择</option>
            <option  value="1" <#if merchantQo.valid=1>selected="selected"</#if>>启用</option>
            <option  value="2" <#if merchantQo.valid=2>selected="selected"</#if>>禁用</option>
           </select>
           </span> 
		   </td>
		    <td></td>
           <td><input class="btn btn-success radius" type="submit" value="搜索" /></td>
          </tr>
      </table>
     </form>
    </div>

    <div class="cl pd-5 bg-1 bk-gray mt-20"> 
    <span class="l">
    <a href="javascript:;" onclick="addMerchant();" class="btn btn-primary radius"> 添加</a> 
    </span>
    <span class="r">共有数据：<strong>${pagination.totalCount}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr  class="text-c">
            <th >登录帐号</th>
            <th >供应商名称</th>
            <th >联系人</th>
            <th >电话</th>
            <th >状态</th>
            <th >操作</th>
        </tr>
        </thead>
        <tbody >
         <#list pagination.list as list> 
         <tr  class="text-c">
            <td>${list.merchantLoginName}</td>
            <td>${list.mercName}</td>
            <td>${list.linkMan}</td>
            <td>${list.linkTel}</td>
            <td>
            <#if list.valid=1><span class="label label-success radius">启用</span>
            <#elseif list.valid=2><span class="label radius">禁用</span>
            </#if></td>
            <td>
             <a href="javascript:;" onclick="lookMerchant('${list.id}');">查看</a>
            <#if list.valid=1>
             <a href="javascript:;" onclick="stopMerchant('${list.id}');">禁用</a>
            <#elseif list.valid=2>
             <a href="javascript:;" onclick="startMerchant('${list.id}');">启用</a>
            </#if>
             <a href="javascript:;" onclick="editMerchant('${list.id}');">修改</a>
             <a href="javascript:;" onclick="deleteMerchant('${list.id}');">删除</a>
             <a href="javascript:;" onclick="resetMerchant('${list.id}');">重设密码</a>
            </td>
         </tr>
         </#list>
        </tbody>
    </table>
    <div id="div_page" style="padding-top: 10px;float: right"></div>
</div>
</div>
<@frame.end "default">
</@frame.end>
</html>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/merchant/query_merchant_list.js"></script>
<script type="text/javascript">
var path="${contextPath}";
laypage({
    cont: 'div_page',//容器。值支持id名、原生dom对象，jquery对象。
    pages: ${pagination.totalPage},//通过后台拿到的总页数
    curr:  ${pagination.pageNo} || 1, //当前页
	skip: true, //是否开启跳页
	first: 1, //将首页显示为数字1,。若不显示，设置false即可
	last: ${pagination.totalPage}, //将尾页显示为总页数。若不显示，设置false即可
    jump: function(obj , first){//触发分页后的回调
        if(!first){ //点击跳页触发函数;当前页为obj.curr
            $("#page").val(obj.curr);
            $("#search_form").submit();
        }
    }
});

</script>